package cn.lefull.mapper;

import cn.lefull.entity.Apartment;
import cn.lefull.entity.PermissionMenu;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @description:
 * @auther: qijiang
 * @date: 2018/12/25 15:19
 */

public interface PermissionMenuMapper {

    @Select("select * from permission_menu_copy  where organization_id = 1 ORDER BY parent_permission_menu_id ")
    List<PermissionMenu> findAll();

    @Insert("<script>" +
            "insert into permission_menu_copy (create_time, delete_time, update_time, ico, is_delete, is_external_link, menu_resource_id, name, operator_employee_id,  organization_id, parent_permission_menu_id, resource_type, url) " +
            " values (#{createTime}, #{deleteTime}, #{updateTime}, #{ico}, #{isDelete}, #{isExternalLink}, #{menuResourceId}, #{name}, #{operatorEmployeeId},  #{organizationId}, #{parentPermissionMenuId}, #{resourceType}, #{url})" +
            " </script>")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int insert(PermissionMenu permissionMenu);
}
